base: fix half reference conversion expecting zeroed target
authorØyvind Kolås <pippin@gimp.org>
Sat, 16 Jan 2016 10:16:22 +0000 (11:16 +0100)
committerØyvind Kolås <pippin@gimp.org>
Sat, 16 Jan 2016 10:16:22 +0000 (11:16 +0100)
As discovered in bug #760703 the reference path is currently expecting
zeroed memory, fix by explicitly zeroing last 32bit of mantissa.

babl/base/type-half.c

index e45e34ad67a040774f8bcec3e9f18425fd2b8724..57b5d7dce239beb4cb7b56322f6e252616f1cb18 100644 (file)
@@ -283,7 +283,7 @@ static void halfp2doubles(void *target, void *source, long numel)
                 *xp++ = (xs | xe | xm); // Combine sign bit, exponent bits, and mantissa bits
             }
         }
-        xp++; // Skip over the remaining 32 bits of the mantissa
+        *xp++ = 0; // Skip over and zero the remaining 32 bits of the mantissa
     }
 }